<?php

    //    ELGG courses admin panel page

    // Run includes
        require_once(dirname(dirname(dirname(__FILE__)))."/includes.php");
        require_once("lib.php");
        
    // Initialise functions for user details, icon management and profile management
        run("admin:init");

        define("context", "admin");
        templates_page_setup();
        $metatags .= "<script type=\"text/javascript\" src=\"" . $CFG->wwwroot . "local/includes/coursesadmin.js\"></script>";
		$metatags .= "<script type=\"text/javascript\" src=\"" . $CFG->wwwroot . "local/includes/shared.php\"></script>";
		$metatags .= "<script type=\"text/javascript\" src=\"" . $CFG->wwwroot . "local/includes/xmlrequest.php\"></script>";
    // You must be logged on to view this!
    
    	// generate page content
   	
        //get all the courses (and whether they are in use by users)
       	$body = displayAdminCourses();
           
		if (!isadmin()){
			$body = "you must be an admin to view this page";
		}
		echo templates_page_draw( array(
                    __gettext("Courses Admin"),
                    templates_draw(array(
                        'context' => 'contentholder',
                        'title' => __gettext("Courses Admin"), 
                        'body' => $body
                    )
                    )
                )
                );

?>